package com.example.demo.controller;

import com.example.demo.config.StreamClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName streamController
 * @Desecription TODO 1.2新增
 * @Author gjy
 * @Date 2021/3/31 14:55
 * @Version 1.2
 **/
@RestController
@RequestMapping("/find")
public class StreamController {
    @Autowired
    private StreamClient streamClient;

    @GetMapping("/send")
    public void send() {
        streamClient.output().send(MessageBuilder.withPayload("Hello World...").build());
    }
}
